#include "common.h"
int FillArgv(char *p,char *argv[],int *pCount)
{
    if(p==NULL)
    {
        printf("p err\n");
        return SYS_ERROR;
    }
    int i=0;
    char *mess=strtok(p," ");
    if(mess==NULL)
    {
        printf("mess err\n");
        return SYS_ERROR;
    }
    while(mess!=NULL)
    {
        argv[i++]=mess;
        mess=strtok(NULL," ");
    }
    *pCount=i;
    return SYS_OK;
}

/*
int main()
{
    char* arr[20]={NULL};
    char brr[]="s 3 5 0 i jsd s";
    int pcount=0;
    int a=FillArgv(brr,arr,&pcount);
    if(a==SYS_OK)
    {
        printf("拆分成功\n");
        for (int i = 0; i < pcount; i++) {
            printf("参数 %d: %s\n", i+1, arr[i]);
        }
    }
    
    return 0;
}
*/
